<script setup lang="ts">
const title = defineModel<number>('title')

function add() {
  if (title.value) {
    title.value++;
  }
}
</script>

<template>
  <div class="border rounded-3 p-3">
    <p>子组件：{{ title }}</p>
    <n-button @click="add">点击</n-button>
  </div>
</template>

<style scoped>

</style>